package com.aoxin.util.enumerate;

import com.aoxin.util.ErrorUtil;

public enum IsWithdraw {
	NOTRECOMMENDED(0,"未获得推荐"), GETRECOMMENDED(1, "已获得推荐金额"),CASHINFAILURE(2,"提现失败"),BRINGUPSUCCESS(3, "提现成功"),
	AUDITING(4,"审核中"),GRANT(5,"发放");
	private int id;

	private String value;

	private IsWithdraw(int id, String value) {
		this.id = id;
		this.value = value;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public static IsWithdraw fromId(int id) {
		switch (id) {
		case 0:
			return NOTRECOMMENDED;
		case 1:
			return GETRECOMMENDED;
		case 2:
			return CASHINFAILURE;
		case 3:
			return BRINGUPSUCCESS;
		case 4:
			return AUDITING;
		case 5:
			return GRANT;
		}
		throw new RuntimeException(String.format(ErrorUtil.OPERATE_TYPE, id));
	}
}
